<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<body>
<h3>用户登录</h3>

<div th:if="${param.error}">
    <p style="color: red;">用户名或密码错误，请重新输入。</p>
</div>
<!-- th:action 定义表单提交路径，method="post" 定义提交方式 -->
<form th:action="@{/login}" method="post">
    <div>
        <!-- name 必须为 "username"，与 Spring Security 默认认证参数名一致 -->
        <input type="text" name="username" placeholder="用户名" required>
    </div>
    <div>
        <!-- name 必须为 "password"，与 Spring Security 默认认证参数名一致 -->
        <input type="password" name="password" placeholder="密码" required>
    </div>
    <div>
        <input type="submit" value="登录">
    </div>
</form>
</body>
</html>
